package com.bmps.springcloud.insuredmicroservice.model.trail.response;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

import java.io.Serializable;

/**
 *  @author lyw
 *  @date 2019/07/24
 */
public class ErrorModel implements Serializable {

    private String errorId;
    private String errorMessage;

    public String getErrorId() {
        return errorId;
    }

    public void setErrorId(String errorId) {
        this.errorId = errorId;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o){
            return true;
        }

        if (o == null || getClass() != o.getClass()){
            return false;
        }

        ErrorModel that = (ErrorModel) o;

        return new EqualsBuilder()
                .append(errorId, that.errorId)
                .append(errorMessage, that.errorMessage)
                .isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37)
                .append(errorId)
                .append(errorMessage)
                .toHashCode();
    }

    @Override
    public String toString() {
        return "ErrorModel{" +
                "errorId='" + errorId + '\'' +
                ", errorMessage='" + errorMessage + '\'' +
                '}';
    }
}
